const Koa = require('koa')
const app = new Koa()
const respDurtion = require('./middleware/koa_response_duration.js')
const respHeader = require('./middleware/koa_response_header.js')
const respData = require('./middleware/koa_response_data.js')

// 绑定中间件
app.use(respDurtion)
app.use(respHeader)
app.use(respData)

// 绑定端口号
app.listen(8001) 

const WebSocketService = require('./service/websocket_service.js')
// 开启服务端对客户端的连接监听
WebSocketService.listen()
